USE [BMIG_MENSUAL_POST_CADENA]

 -- creating the store procedure
IF EXISTS (SELECT name 
	   FROM   sysobjects 
	   WHERE  name = '[dbo].[WASP_M0006_CREATE_TABLE]'
	   AND 	  type = 'P') 
	DROP PROCEDURE [dbo].[WASP_M0006_CREATE_TABLE]
GO
create procedure [dbo].[WASP_M0006_CREATE_TABLE]  AS
begin
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[colocacion_mensual_credito]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    begin
      drop table [dbo].[colocacion_mensual_credito]
    end
    
    begin
      CREATE TABLE [dbo].[colocacion_mensual_credito] (
           AGENCOLOC smallint NOT NULL,
           CRCREDITO	VARCHAR(9),
           RUTTRABAJA	varchar   (10),
           FNACITRABA	varchar(8),
           SEXOTRABAJ varchar(1),
           CRMONTO	varchar(11),
           CRCUOTAS	VARCHAR(2),
           CRTASA	varchar(8),
           CRCLASE	varchar(1),
           CRTRAPEN varchar(1)
      )
    end
end
